<template>
  <div class="hello" >
    <h3>请输入详细资料</h3>
    <div v-if="username.length!=0">
      <div v-if="username.length!=0">
            <h3>姓名：{{username}}</h3>
            <h3>性别：{{picked}}</h3>
      </div>
      <div v-else>
            <h3>请输入姓名</h3>
      </div>
    </div>
    
  </div>
</template>

<script>
import {EventBus} from "../utils/eventBus"
export default {
  data(){
    return{
      username:"",
      picked:""
    }
  },
  props: {
    
  },
  mounted(){
    EventBus.$on('username',(username)=>{
        this.username = username
    })
    EventBus.$on('picked',(picked)=>{
        this.picked = picked
    })
  }
}
</script>

<style scoped>
.hello{
  width: 50%;
  height: 100vh;
  background-color: skyblue;
}
</style>
